{extend name="public:layout" /}
{block name="title"}订单发货{/block}
{block name="head"}
<style>
    .gray-bg{background:#fff;}
    #form {padding-top: 8px;}
    .form-group{padding-bottom:8px;border-bottom:1px solid #f4f4f4;margin-bottom:8px;}
    .wrapper{padding:0;}
</style>
{/block}
{block name="body"}
<div class="wrapper">
    <div class="ibox">
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input type="hidden" name="pay_code" value="line" />
                <div class="form-group">
                    <label class="col-sm-2 control-label">客户信息:</label>
                    <div class="col-sm-10">
                        <p class="form-control-static">下单人:{$orderInfo.buyer_username}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">支付内容:</label>
                    <div class="col-sm-10">
                        <p class="form-control-static">订单金额:<span class="text-danger">{$orderInfo.order_price}</span>元 已支付:<span class="text-success">{$orderInfo.pay_price}</span>元</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">退款金额:</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <span class="input-group-addon">$</span>
                            <input type="text" class="form-control" datatype="*" name="refund_amount" value="{$orderInfo['pay_price']-$orderInfo['refund_amount']}" />
                            <span class="input-group-addon">元</span>
                        </div>
                    </div>
                    <label class="col-sm-2 control-label">经手人:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="action_name" value="{$actionName}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">退款方式:</label>
                    <div class="col-sm-10">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="refund_type" value="1" checked /> 退回到会员帐户
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="refund_type" value="2" /> 银行转账、现金交付等
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="refund_type" value="3" /> 原路退回
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">申请原因:</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="buyer_message" value="" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">
                            新增退款记录
                        </button>
                        <a href="javascript:;" onclick="closeDialog();" class="btn btn-white">取消返回</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub',function (res) {
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.location.reload();
            parent.layer.close(index); //再执行关闭
        })
    });
    //关闭窗口
    function closeDialog() {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index); //再执行关闭
    }
</script>
{/block}